import React,{useEffect,useState } from 'react'
import * as api from '../../api/index'
import {useDispatch,useSelector} from 'react-redux'

import { Sidebar, Toast } from 'react-vant';
function Classify() {
  const dispatch=useDispatch()
  const [active, setActive] = useState(2);
  useEffect(()=>{
    dispatch(api.getList())
  },[dispatch])

  const listd =useSelector(state =>{
    return state.reducer.list
  })
  console.log(listd)
  return (
    <div className='Classify'>
        <Sidebar
          value={active}
          onChange={(v) => {
            setActive(v);
            Toast.info(`标签名 ${v + 1}`);
          }}
        >
          <Sidebar.Item title="标签名1" />
          <Sidebar.Item title="标签名2" />
          <Sidebar.Item title="标签名3" />
        </Sidebar>
        <div className='cents'>

        </div>
    </div>
  )
}

export default Classify